package com.leyou.common.exception;

import lombok.Data;
import lombok.Getter;
import org.joda.time.DateTime;

/*
* 自定义异常返回的结果：
* 1.状态码
* 2.异常信息
* 3.时间戳
* */


@Data
public class ExceptionResult {
    private int status;
    private String message;
    private String timestamp;

   public ExceptionResult(LyException e) {
        this.status = e.getStatus();
        this.message = e.getMessage();
        this.timestamp = DateTime.now().toString("yyyy-MM-dd HH:mm:ss");
    }
}
